Started core refactoring