Refactor function to just a return