moved exception processing in independent method