use Result instead of deprecated SimpleResult
simplify code