Refactoring continues
Major refactor