small code refactorings