lots of cleanup of style and naming