Refactor macro edit methods to be more generic