attachment refactor to modal