Made the adapter dynamically configurable.

fixes #6
fixes #7