refactor evaluation_stage helper functions