move getOnce to tools
refactor init
split init and ready stages
use init state