Remove and move auth code