updates a little the design of the code