improved more functions