removes unnecessary codes