refactory the init
refactory the init