cleanup and fixes