Fix: removed global variables