restructure fixes for cli tool