rewrite the app