first clean up and fixes