Fix redirect, and refactor handler construction