split gem handling into two tasks: clear & refresh