Re-organizing stuff and fixes