Fixes #51 + Refactoring for command line arguments