Some further improvements for performance