added dependency injection and removed some unnecessary files