Break loop early, cleanup declarations

@PKEuS: I cannot agree - there's a lot of code afterwards. How does the reader know the value isn't changed? With `const` this is kind of assumed.