Refactoring, code cleanup.