improve efficiency by remove flat