Refactoring, cleanup.