Yuck!  Refactor please.