unified struct, improved formatting and comments