Code cleanup and indentation