library constructor refactor