small fixes and improvements to organize