Wrap all the crazy stuff in a OO library