refactoring using new controller mechanism