get rid of duplication code
fix conflicts