trimming unneccesary code