refactored models and fixed event model table creation issue