move around some init logic that should not be only interactive
merge from master