I feel like I've read this code once before.  Have you duplicated things unnecessarily?