reorganized code for the spotlight app