v0.2 refractored the code to make use of enum states and parsing