Replaced UNIONs with sub-queries