Code cleanup and alignment