refactor for dependencies