Refactoring Value class