helper function to perform an action at a currently touched cell.