beautify and try to get toggle working