implement extractors, some cleanups