only keep essential functions