Moved OS-dependent stuff into dedicated class