Refactoring into a class.
Moved remaining code into functions, doesn't work together.