Nice cleanup, removing duplicate logic.