A walkthrough for refactoring, using promises, classes, and self-references.