refactoring common parts and useless code.