some cleanup and dry