Refactor redpile helper method for specs to return the result