renaming matrix type

and some dead code removal