Revert "Revert "Revert "Minor cleanup of code"""

This reverts commit fa997cc9bbcb578b868fedf3d85069da429c2ed5.