refactor based on core changes