Refactored for new API