Reduce API footprint through refactoring of top-level classes into anonymous ones returned by util methods.