improve setNumber method