Refactor argparser for better data encapsulation and add testing