refactored, support to recover from errors, ...