A bit of refactoring!