get rid of unnecessary stuff from template