refactored facet handler