some cleanup in the code