Some more refactororing