cleaning up flag parsing