Moved extract logic to Variable