Some refactoring done.
Some behaivor of the controls is implemented.