pull lifecycle callbacks out into their own module
pull primaryKey criteria out into standalone helper function