Refactored wing elements into functions