duplicate code removal