code cleanup and reformatting.