refactor destructure macro based on natefaubion's work