refactor the Dagger implementation