Rewrite closure for more structured and easy-to-read code
Rewrite closure for more structured and easy-to-read code

Signed-off-by: Matthias Beyer <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@beyermatthias.de>

matthiasbeyer/imag,matthiasbeyer/imag