even more refactoring.