remove function factory