refactored code for long click