a little bit of code optimization