added some optimized funcs