The code has been pruned and better organized