Removed similar code by creating a new class

The new class has the possibility to implement the functionality of all
classes which are derived from NamedValue