removed some duplicated code, fixed some erros in tests command and visualization command