optimization by inline hotspot functions