egg refactored