Refactor a bunch of silly dependencies into a common class.