Even some more refactoring