refactor the adapter design