Revert "Revert "fix style""

This reverts commit fbe4531f06432898c659fa0ff9f945df8eacf00b.
convert jQuery Deferred objects to Promises