condense (apply concat (map f (map g xs))) into (mapcat fg xs)
condense nested ifs into one and make nil cases implicit