Refactor _weightTypes function commonality to new helper function _calculateTypeWeight.  Cleaned up code and added comments.