base class for models

(cherry picked from commit 1fbfb81986668fef82ecc15a128937baebbf1286)