Code refactoring. Seems to have fixes entropy.