Refactored matrix multiplication handlers