refactoring to dependencies