optimize some minor changes