Caching of extracted features and code cleanup