remove mutables from generic and template