Move matrix calculations back to Transform class.