todo: make this less shitty