Modernize authorization; remove dead code