Encapsulated old orm specific code to helper