Refactor packages, add gesture handling