Refactor dynamic