refactor (lib)