Refactor various whitespace, flash messages, and redirects