Performed some minor code refactoring.