reducing scope of local variables, making things final, etc