Refactoring work in progress