Some other minor refactoring