Code cleanup and standardized style