optimization + #include fixes