updated for latest refactoring