wp/CAROLINE-37/1: adds crash class and some refactoring.