Refactored app out of cli.init