Downgrade some dependencies version.
Some refactoring.