Some optimalizations