Improve formatting and comments