Cleanup, minor refactoring