improve default value calculation