Some extra refactoring