implement CLI. Thorough framework restructure