Removed unneeded import.
Added a class that holds the commandline arguments.
Extracted most parts into their own functions.