changed references to models to use tables