Started to clean up the code.