Refactor class route through exception