improve command line parsing and build