move route definition logic to app