Refactored traverser, decoder, evaluater as functions.