Refactor and regenerated libs