a little cleaning of the code