Cleanup for 2.3
Initial core refactorization