finish trimming helper functions (without tests), need to add command