Some additional refactoring