I spoke about the the whole if/else condition. It is not easy to override indexAction method, you are use the bundle standalone.