Initial refactoring in the direction of a more event-oriented approach