Revert "Made code slightly more modular"

This reverts commit fb0fb3b4521c632ed7fc64d65d616dec4d1512bd.
Whoops, accidently deleted stuff