Minor code refactorings.