finalising refactoring