couple of refactorings