Try to reduce duplication in these controllers