refactor model introspection into a mixin and implement pagination mixin