just a bit of refactoring