More cleanup / refactoring