remove unnecessary definitions and consts