- more robust command line parsing
- general refactoring