slightliy improve codes