cleanups & cli interface improvements
more cleanups & type annotations