extract out calculating into a class
extract command parser