type fix and template removal