Refactoring and cleaning dependencies