refactored core using new macro