clear duplicate code