remove unnecessary code
unified all random functions
use promise wrap up functions
extract methods to utils