Use callback to handle async result
Prevent using global variables