implementing high-level interface, mainly for REPL (in progress)