Unified the data handling on different systems, some cleanup