code cleanup

Added base class Value
Added base class Element
Minor code cleanups