Move platform utility functions to separate module