Moved the template related sections to the bottom , as these were adding empty lines, breaking up the source