Minor code refactoring.