@ccornelis Lines 335-344 look identical to lines 353-362. Consider extracting those to a common method too.