one of these days I will make this less awful