Use blocks instead of exception handling