refactor onclicks