Refactor Matrix*