New refactor seems to work