refactor stencil access