extract config to app.yaml
code refactoring