Define command line options and refactor configuration mechanism