Performed some refactoring.