optimization improvements