[TASK] Remove global declarations inside methods