Replace $collection with $table in models