Minor refactor of code

Changes:
 - Don't mutate original ``var_dict`` with an ``update``
 - Clean up exception handling code
 - DRY-er return value