Refactored evaluate method for easy reading