Refactor toggle commands to extract structure