code cleanup and indent