Refactoring `this.routes()` to be more robust, fixes #320