refactor result returns