Some changes for better performance