Reorganized so that definitions cannot access global object