Use try catch instead of throwing the excceptions