bit of refactoring 2