header cleanup and guards