Use explicit step limit instead of random quality.
Refactor state system of main frame.