refactor smartresult