remove unnecessary fields and conditions