Use consistent syntax for complex code replacements
Further promisification cleanups