Finish main publish refactor, ready for testing!