added EventFactory class, fixed some tests