MAIN-1879: Local sanitization of variables

Switched to local sanitization @themech @nandy-andy @Grunny can you take a look?