refactor; main method just two arguments.