Simplified library, left just the right code