Remove extract

Get rid of extract as it makes code difficult to follow.