Refactored static functions in common.LossFunctions
Updated to reflect recent changes