trim_code may have been improved