refactor click logging