some cleanup and small changes