refactoring getValueBounds