get rid of unused-var-error in a more elaborated way