Refactor to use new library