code cleanup for Mac/Linux