Some bit of refactoring
Beginning with event handling