Code cleaning and added arguments