Improved coding conventions and logging