moved command line lookup closer to where it is used for clarity