first phase refactor done, get rid of CLI refs