removed console.log calls from refine()