unduplicate code