refactored server code to use express3-handlebars middleware