Refactored matrix transforms