split work into a lib