code & performance optimization