abstract mobile interactions js

DRY up repeated code and simplify logic.