code cleanup + spelling fix