small code refactorings.