Convert trim to static method