Cleanup and use promises instead of callbacks.
WIP: decision making