Refactor some small amount of duplication into a method