Trim redundant code