remove case and contract from ast nodes