created Model class, removed all globals