implement event model and controller