is this code different from the other ORM/ODMs? if not then maybe this should be moved to a template?