replace entity with model