Zaslat SMS: Minimal factorization of matrix and operator functions