Make background authorization work
Remove obsolete code and comments