Refactor creation of Result object