some micro optimazation improvements