Break loop early, cleanup declarations

Imho it is pretty useless to use const here.