added Ralfs comments, factored out onClicks