Refactored evaluate_* functions