remove code duplication is cross