code optimization done for controller classes