exploring plateau code refactored