Get rid of hard-to-read and unnecessary use of .apply