Reuse expensive values to improve issue #49