totally refactored event handling and domain