Minor refactoring made.