local functions made static, more const params