refactor and introduce DependencyInjection
refactor
before directory refactor