Cleanup and Refactor

Ready to hand in