T3: Optimize code and fix strict standard warning