fix non recursive copy, refactor to move some functions from silk