factor into a library component and an executable component