Library code simplified.