Update the logic. Change matrix to ref.
Fix a bug on getTransformMatrix.
Change matrix to factory logic.