rebrand and logout code