refactored and simplified like there's no tomorrow