Changed lots of things, mainly to prepare architectural changes