Code cleanup and reformated.