Updated for new refactoring