added touch/no-touch test and refactored a bit