extracts base exception handling into a method