Refactored new facet code