your exception idea to avoid local side effects is the way to go