add import_cmd and other tidyups