Move some variable init to toolkit to avoid errors