Use js closures.
Do not use global app obj.