Added onResultMethod and make it simplier to use