Some minor refactoring changes