Performed minor refactoring.