Some more refactoring here