GENERAL: small code optimizations