get min
get max
Refactoring