Refactored some code on binding redirects and made some helper functions to make it easier to consume.