Pull data cleaning out into it's own function, so I can then make it less evil