More cleaning and removal of duplication