a slightly more elegant parsing scheme