Avoid assignments to free variable
Do not initialize smex at startup