Move splitIntoWords function outside of Words function