Restructured and refined inReach code