adding extract action and pulling extract logic out of the set action