restructure code, group radio buttons