Matrix classes reorganization