Maybe a line break or two in this function would make it more readable?