optimization in clicking functionality