Refactor return and check for None