refactored Core