bitq: reduce scope of variables