try to move some common logic into base controller