cleanup and tune