Made controller element functions generic.