breaks out matrix and metadata functions to separate methods