cleanup and more fixes