switch object implementation