Optimization of Parse and clean up code.