refactored factory & repository in EventHandler

s.o.