this is an obvious case of battling the type system that just gets in the way. The "before" version obviously sucks, but the "after" with magic sprinkled in - sucks even more! is there an alternative solution?