Finish refactoring (again)