unify mutable and immutable parser