refactor epac module and add argparse