Working on cleaning up internal API and shell interface