refactor for dependent library