Extract things out into their own methods, instead of having everything in the constructor

This abstracts various things into their own methods which makes the code a little easier to work with.