Small clean-up.
Improved AT code readability, even I had trouble reading/editing it.
Globals to locals.