Code cleanup/refactoring.