Some code tuning