Extract some common behaviour to a before filter