Further refactoring to new data types