1.optimized code
2.add marage function from controller/Controller.php