Organized some of the code.