Refactored expression optimization/compiling into container, removes duplicates from catalogs.