More cleanup/refactoring