Refactoring some code cleanup issues.