rewrite to procedural style with differing lifetimes
move parsing into constructor.