Further cleaning of the code