Move location initialization to document