refactor to allow for more consistent pluggable backends