refactore code to use the build method for each adapter to initialize an adapter with all dependencies