Get all working
Refactoring
Lots of refactoring