break up another megafunction