Don't duplicate the code-- find a way to share it.

FYI, this is a great book to read about good coding practices:
http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882