Refactored argument parsing, general organisation