perhaps the two or three functions around dealing with evaluations could be separated in a module?