event source done (ugly), need refactoring and tests