Refactorings and removal of old dependencies