Some more nice refactoring