refactor danfe controller