Remove unnecessary try/with block