remove unneeded whitespace from template