dep11: Split large codeblock into smaller parts

This was necessary for a while now. This solution is much better to
maintain.