added trim methods for spaces