can pass templateName as an object instead of reading files