optimize some methods