Code cleanup and indentation fixes (now using 4 spaces)