Formatting and removing extraneous code