Fixed api to be easier to use.