Refactor to use tracker and promises.