Refactors into new Dependency class