Factored out redundant controller code