Remove some unused variables and move deprecate and extend to their own modules.