refactor getTaskInfo to use reflection class instead some weird solution