a wee bit o refactoring