improving complexity of application controller