Make function generic for future use (click event)