duplicate code reduction