refactoring and add guesture