Minor changes to improve performance