Basic cleanup/refactoring