refactor code, change struct Value