Improve consume-function