Basic refactoring to use standard collections.