Some code optimization