Refactored into an app+cli