Move const declaration to the beginig of function