refactored for new 0.12 codebase