Minor changes to improve the performance