refactored global structure