refactored for metahub