Refactored DAOFactory template. refs #497