rewrite extractor with utils
now extraction local env stores only symbol IDs, not symbol types
refactor