improved duplicate-method-code