Made it slightly less hacky