refactoring of TypedValue