I guess I could have refactored this to reduce code  duplication.