refactoring: Eval as global function