Improve syntax & create helper function