refactor CLI arguments and response functions