delete rubbish and merge