Minor refactoring in code.