trim some useless code