minor modifications to code and templates