Refactor into an app