Gutted, broken, dirtier code

:scream_cat: 

Exactly the same as #305 but without the merge conflict.