moved secure stuff into global section