Lots of fixes/organizing