Minor reformatting and code simplication