Remove class references and replace with constructor.