Toggle for keys is added, code cleanup