Refactor to allow direct use of BTEngine.