minor changes to improve performance