added UNKNOWN_REFINEMENT to switch statement (to resolve a compiler warning).
Made exception catcher more generic.