More duplicate code cleanup