Factorization of matrix functions and the resolvents of certain operators