refactor UI framework touch handling