Organize more and fix some build errors