Starting from @damellis suggestions: https://github.com/arduino/Arduino/pull/3019#issuecomment-95699278