Small code refactorings