fixed toggle display; refactoring