Cleaned up the data module code