configurable, some modifications for exception handling