Can we talk re: making this function more readable?