Please refactor this into a helper method