Removed unnecessary codes and references
Add exceptions and refrect the result to UI