Refactored the mess from earlier