refactored the crap out this

maybe literally