made parser a little more dynamic