some cleanup of the code