moved radio code into factory to be used in other controllers not just HTML