various small optimizations (frontend)