Refactored the de_novo_matrix retrieval part, but
Need to write unittests,
Need to test if everything works correctly after the refactoring