Sanitize code

Remove redundant trys and dos.