Fixed button click "bugg" + Code cleanup