some refactoring and hid overflow