Cleaning up some NOCOMMITs and a bit of refactoring