better arrangement for button clicking