add several methods, optimize some