Min, max and small refacto