Optimize variables