refactor to use Core