re-arrange logging statements