Update libraries and try to simplify a few things