refactored _getSafeElemSize()