Added logic for handling various platforms