Refactor for use with results hash