Don't repeat yourself.
Merged bug25044
Merge heads