Refacoter CLI code. Remove redundant variables.