Refactor init-shell