using a promise instead of this callback would definitely be cleaner here