Easier way to handle routes

I already had it implemented I just didn't know how it worked. The last commit is the same functionality but with a lot more code. This one is simple and short.