refactor library. version paramter for the future