refactored key controls