Move some code which were providers back to actions as that is more appropriate