Starting work on refactoring