Improve to work with new style arduino code