I can use regex in case statement.
Refactor min / max quality values calculation.
Added comments to code. Changed update_quality action name.