Tidying up codes and removing useless comments