few refactorings