Refactoring Completed ready for testing