ch 6: removed global app variable