Refactored according to feedback: created class UndefinedValue and dismissed the defined flag. Moved all the logic of interpreting statements in a statement interpreter. Gave up the statementsLeft attribute on session and always re-evaluate the whole form.