core refactoring