Rewrite redeclare logic as helper method