Some simple refactoring from code review suggestions