simplify by using try!
avoid some unnecessary locals