clean up BasicMatrixValue and its factory