anyref refactor, fails
more refactoring