Code Cleanup and Improvements [1]

This a little bit of cleanup and code improvements for Groovy.

These commits are deliberately split up by projects so that if necessary, it can be cherry picked.

This is one of the many upcoming cleanups.