Refactor data cleaning script a bit