Disabling and enabling of buttons; removal of not necessary routines