Small refactoring based on feedback from @jdreaver