The code should be refactored a lot. We can also use [argparse](https://docs.python.org/3/library/argparse.html) to make argument management easier.