Gauge theories with non-trivial backgrounds