Reduced the amount of redirect by using the Mustache and made the code easier to follow