lib logic cleanup.