simplify flag parsing a little