Refactor

Total refactor to match class diagram and design.