construct click functionality around grouped elements