src: reduce scope of variables