refactor the codes
resolve the conflicts