More work on refactoring