removed unnecessary template
generalizing uses of HOSTNAME
changing plain HttpResponses to messages and redirects