this section probably deserves to be its own function