Partial re-work towards more flexible parsing.