cleanup: move declarations of external objects into header files