refactoring core_functions ready 2/24