begin migration of functions into library module