move logic back to controller of calling app