More refactoring - use of EJS templates and JSON.