refactor three