Small clean up and improvements on the code.