corrected the code style and remove the nnecessary thrown Expections