[CUR-324] More refactoring and removing deps of removed files.