Further cleanup and reformatting