rewrite the model ORM