Break loop early, cleanup declarations

@PKEuS PMFJI I must agree with Dmitry-Me. This use of const helps much for every later review/rework. If a variable isn't variable (but can not be omitted), adding const shows obviously that it is just an alias.