refactoring functionality to toggle staging keys