Add secret token + re-arrange code