make flyout code clearer