added define_value_method to reduce duplication

Change-Id: Id65c116232666bc46fa640d2fbacb1eeb67d826b