New routing logic and reconfigured app.js