Took some code out of admin controller