Moved trim function higher in ecryption traits