a bit more of refactoring