Refactor to shorter function (#poodr)