Small reorganization of code, so that it is more readable.