Refactor to prevent premature return.