[CLEANUP] Ensure variables initalized and fix code smell