refactored templating to use platform's line separator.