fix formatting and remove old unused globals