switching around some sections
gradually adding support for reading templates def from file