cleanup macosx code