Code cleanup and reformatting.