Refactored loadclicker function using closure