More idomatic refactoring