refactor adapter code to use implicits