fix: preserve order of entities when copying
clean up