Refactor double-click example