Sorta feels like this could be cleaner.