refactored ncoreapi.hpp