refactor out duplicate incrementing