DG: Remove duplicate code