regroup method
optimize the controller code