Refactor spark to use new adaptor interface