Refactor: return early to remove the code indent