Refactor the lib in a object way. Example working with the new API