Implemented logic for "BestMix" feature, some refactoring