removed dependence on flags and insted depends on the user configuration
to do the right thing