style changes and improvements in readability