improved exception handling, now GCM refactoring