Move factory codes to app.js using resolve to load data (neighbors and capital) before showing the view, but need to refactor again