some clean up to make this more readable