[expectations] Improve expectation generation