improve extract for use in REPL w special cases