Refactor shell with golang