Sort imports; remove unnecessary try–excepts