Git optimize button slider on click function by caching it's target nb