code indentation and cleanup