Simplify code
Polishing
Catch exn