cleanup macosx code again