Pass document variable to reduce size & improve performance - 0.1.8